﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using DataService;
using DTO;

public partial class Account_editMainContact : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MainContactSubmit1.CompanyName = UserLogin.Customer.CompanyName;
            MainContactSubmit1.Contact = UserLogin.Customer.MainContact;
        }
    }


    protected void btAddUser_Click(object sender, EventArgs e)
    {
        using (ContactService service = new ContactService())
        {
            UserLogin.Customer.MainContact = MainContactSubmit1.Contact;
            UserLogin.Customer.CompanyName = MainContactSubmit1.CompanyName;

            service.SaveMainContact(UserLogin.Customer);
            Response.Redirect("Default.aspx");
        }
    }

}